-
-
Notifications
You must be signed in to change notification settings - Fork 32
Unsafe Challenge Overrides #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8e7965c to
8bfc795
Compare
8bfc795 to
bf2308c
Compare
| public var challenge: [UInt8] | ||
| /// The Relying Party should store the challenge temporarily until the authentication flow is complete. When encoding using `Encodable` this is encoded as base64url. | ||
| /// | ||
| /// - Warning: Although the challenge can be changed, doing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. See ``setUnsafeChallenge(_:)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just remove this from the API docs, I don't think we need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in favor of a SeeAlso
| /// Unsafely change the challenge that will be delivered to the client. | ||
| /// | ||
| /// - Warning: Although the challenge can be changed, doing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. | ||
| public mutating func setUnsafeChallenge(_ newValue: [UInt8]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public mutating func setUnsafeChallenge(_ newValue: [UInt8]) { | |
| public mutating func unsafeSetChallenge(_ newValue: [UInt8]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed.
| /// encoding using `Encodable`, the challenge is base64url encoded. | ||
| public let challenge: [UInt8] | ||
| /// | ||
| /// - Warning: Although the challenge can be changed, dooing so is not recommended and can lead to an insecure implementation of the WebAuthn protocol. See ``setUnsafeChallenge(_:)``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change them right now!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in favor of a SeeAlso.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, should I have kept the warning on unsafeSetChallenge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah keep the warning on unsafeSetChallenge, we just don't need to include it on the main parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
bcbbefb to
495b3ae
Compare
I'm still unclear why folks would want to change how challenges are generated, but this change let's them do so with the appropriate warnings in place by adding unsafe setters for changing the challenge returned by the manager. Closes #72